﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace zichan.Entity
{
     public class IP
    {
        [Key]
        public int Id { get; set; }
        [Required(ErrorMessage ="机房必填")]
        public int MachineRoomId { get; set; }
        [NotMapped]
        public string MachineRoomName { get; set; }
        [Required(ErrorMessage ="IP不能为空")]
        [RegularExpression(@"((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))",ErrorMessage ="请输入正确格式的IP地址")]
        //[RegularExpression(@"((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))",ErrorMessage ="请输入正确格式的IP地址")]
        public string Ip { get; set; }
        public int? isDelete { get; set; }
        /// <summary>
        /// 非空则为已使用过
        /// </summary>
        [NotMapped]
        public int? IsUsed { get; set; }
        [NotMapped]
        public string statuName { get; set; }
    }
}
